<?php
namespace app\index\controller;

use app\common\controller\HomeBase;  // model
use think\Db;                       // db

class Index extends HomeBase
{

    protected function _initialize(){
        $nav = model('nav')->where('status',1)->select();
        $site_config = Db::name('system')->field('value')->where('name', 'site_config')->find();
        $site_index = Db::name('system')->field('value')->where('name', 'site_index')->find();
        $site_index = unserialize($site_index['value']);
        $site_config = unserialize($site_config['value']);
        $this->assign('site_index',$site_index['site_index']);
        $this->assign('small_img',$site_index['small_img']);
        $this->assign('dynamics',$site_index['dynamics']);
        $this->assign('site_config',$site_config);
        $this->assign('nav',$nav);
        // $complet_info = [
        //     'complet' => '广州聚购网络科技有限公司' ,
        //     'simple'  => '聚购'       ,
        //     'telephone'  => '020-28988172',
        //     'manager'  => '陈经理'       ,
        //     'phone'  => '13922215900'       ,
        //     'address'       =>  '广州白云区机场路1962号国际单位二期A3栋2楼全层'
        // ];
        // $this->assign('complet_info', $complet_info);

    }

    /*
     * 首页
     * @author xiongan
     * @date 2017 02 04
     * */
    public function index(){
        return view('index');
        //从数据库读取信息显示
    }
    /*
     * 联系我们
     * @author xiongan
     * @date 2017 02 04
     * */
    public function contact(){
        return view('contact');
    }
    /*
     * 关于我们
     * @author xiongan
     * @date 2017 02 04
     * */
    public function about(){
        return view('about');
    }

    /*
     * 关于我们
     * @author xiongan
     * @date 2017 02 04
     * */
    public function workroom(){
        return view('workroom');
    }


    public function party(){
        return view('party');
    }


    public function activity(){
        return view('activity');
    }
	
	//public function foruser(){
	//	for($i = 100;$i < 201;$i++){
	//	$data = "INSERT INTO `tp_users` 
	//	(`email`, `password`, `paypwd`, `sex`, `birthday`, `user_money`, `frozen_money`, `distribut_money`, `underling_number`, `pay_points`, `address_id`, `reg_time`, `last_login`, `last_ip`, `qq`, `mobile`, `mobile_validated`, `oauth`, `openid`, `unionid`, `head_pic`, `province`, `city`, `district`, `email_validated`, `nickname`, `level`, `discount`, `total_amount`, `is_lock`, `is_distribut`, `first_leader`, `second_leader`, `third_leader`, `token`, `message_mask`, `push_id`)
	//	 VALUES 
	//	('', '519475228fe35ad067744465c42a19b2', NULL, '0', '-28800', '9999999.00', '0.00', '0.00', '0', '100', '0', '1507290829', '0', '', '', '13111111".$i."', '1', '', NULL, NULL, NULL, '0', '0', '0', '0', '·点点', '1', '1.00', '0.00', '0', '1', '0', '0', '0', '', '63', '0');";
	//	echo $data.'<br />';
	//	}
	//}

}
